﻿using ReflectionStudio.Core.Events;
using System.ComponentModel;
using System.Data;
using System.Threading.Tasks;
using System.Windows;
using System.Collections.Generic;
using INTEX.SCHEDULER;
using System.Windows.Threading;
using System.Windows.Controls;
namespace WPFExcelReport
{
    /// <summary>
    /// Interaction logic for EditEventWindow.xaml
    /// </summary>
    public partial class TSAV33AM
    {

        public TSAV33AM()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VICC_MKRF();
            DataContext = MV;
            InitializeComponent();
        }


        private void LoadMKRF()
        {
            TMV.VKK.UVKK04(null);
            dwData = TBMain.NewRow();
            dwData["ABFMANDANT"] = app.Mandant;
            dwData["ABFKSTKRS"] = KSTKRS;
            dwData["ABFKST"] = KST;
            dwData["ABFAGANG"] = AGANG;
            dwData["MKFERLKZ"] = " ";
            SResult = TMV.QTMKRF03(dwData);
            TMV.MergeData(SResult, true, true);
        }
        public override void LOADBYAUF()
        {
            if (ORDERNUM.Length == 0)
                return;
            filter = "ABAID='" + ORDERNUM + "'";
            rows = TBMain.Select(filter);
            filter = null;
            foreach (DataRow row in rows)
            {
                filter = "ABFBLFDNR='" + row["ABFBLFDNR"].ToString() + "'";
            }
            cvMaster.CustomFilter = filter;
            Locate("ABAID", ORDERNUM);
            base.LOADBYAUF();
        }
    }
}
